#ifndef MONITOR_H
#define MONITOR_H

#include <QThread>
#include "warn.h"
#include "Timer.h"

class monitor : public QThread
{
    Q_OBJECT
public:
    explicit monitor(QObject *parent = 0);
    void run();
    void start_Vacuum_pump_timer();
    void stop_Vacuum_pump_timer();
     QTimer *water_valve_open_timer;
     void stop();
     void set_pin(volatile uint *GPIO_Port,int pin,bool bvalue);
     void set_output_pin(int num,bool bvalue);
     void set_pin_value(int pin,bool value,bool &IOstatus);
     void delay_heat(bool b);
signals:
    
public slots:
        void heat_slot();
private slots:
    void leak_water_timeDone();
    void Vacuum_pump_timeout();
    void water_supply_timeout();
    void water_valve_open_timeout();
    void Vacuum_pump_leak_cooling_water();

private:
    inline void heating();
    inline void overpressure_protection();
    inline void water_level();
    inline void Vacuum_pump();
    inline void workable_func();
    inline void timing();
    inline void read_IO_stats();
    bool read_IO_status(int num);
    bool read_pin(volatile uint *GPIO_Port,int pin);

  QTimer* leak_water_timer;
  QTimer* Vacuum_pump_timer;
  QTimer* water_supply_timer;
  QTimer* delay_heat_timer;
  bool light;
  bool b;
  bool SPK;
  bool heat_valve;
  bool Vacuum_pump_cooling_water_timer_isrunning;
  uint count;
  uint count2;
};

#endif // MONITOR_H
